package com.thinkverse.common.result;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 返回结果状态码枚举
 */
@Getter
@AllArgsConstructor
public enum ResultCode {
    
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    
    // 参数错误
    PARAM_ERROR(400, "参数错误"),
    PARAM_MISSING(400, "参数缺失"),
    PARAM_INVALID(400, "参数无效"),
    
    // 认证授权错误
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "禁止访问"),
    TOKEN_EXPIRED(401, "Token已过期"),
    TOKEN_INVALID(401, "Token无效"),
    
    // 业务错误
    USER_NOT_FOUND(404, "用户不存在"),
    USER_ALREADY_EXISTS(409, "用户已存在"),
    PAPER_NOT_FOUND(404, "论文不存在"),
    SEARCH_ERROR(500, "搜索服务异常"),
    
    // 系统错误
    SYSTEM_ERROR(500, "系统内部错误"),
    SERVICE_UNAVAILABLE(503, "服务不可用"),
    DATABASE_ERROR(500, "数据库操作异常"),
    NETWORK_ERROR(500, "网络异常");
    
    private final Integer code;
    private final String message;
}
